#ifndef ENTITY_H
#define ENTITY_H

#include "Body.h"
#include "Position.h"
#include "Texture.h"
#include "Color.h"
#include <stdio.h>

#include <windows.h>
#include <gl/GL.h>
#include <math.h>

class Entity
{
protected:
	Position m_pos;
	float m_width;
	float m_height;
	bool m_toDelete;
	Texture m_texture;
	Color m_color;
	bool m_border;

public:
	Entity()
	{
		m_toDelete = false;
		m_border = false;
	}

	Entity( const Position& pos )
	{
		m_toDelete = false;
		m_border = false;

		m_pos.x = pos.x;
		m_pos.y = pos.y;
	}

	virtual bool shouldUpdate( const Position& playerpos )
	{
		return true;
	}

	virtual void update( float frametime ) = 0;

	virtual int intersects( Entity* ent ) = 0;

	const Position& getPosition() { return m_pos; }
	Texture& getTexture() { return m_texture; }
	bool hasBorder() { return m_border; }

	float getWidth(){ return m_width; }
	float getHeight(){ return m_height; }

	void setWidth(float width){ m_width = width; }
	void setHeight(float height){ m_height = height; }

	bool toDelete() { return m_toDelete; }
	void Delete() { m_toDelete = true; }

	const Color& getColor() { return m_color; }
	void setColor( const Color& c ) { m_color = c; }

	virtual void setIntersect(Entity* ent, int side) = 0;

};

#endif // ENTITY_H